package com.zhou.common.mybatis.template.shiro.zhou.config;

import com.zhou.common.mybatis.template.shiro.zhou.filter.UserCenterLoginConfigurer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * SpringSecurityConfig
 *
 * @author zhouxianfeng
 * @date 2021-4-29
 */
//@Configuration
public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    RequestMappingHandlerMapping requestMappingHandlerMapping;

    @Override
    protected void configure(HttpSecurity http) throws Exception {



        http
                .regexMatcher("/test1")
                .authorizeRequests()
                .anyRequest().authenticated()
                .and()
                .apply(new UserCenterLoginConfigurer<HttpSecurity>())
                .and()


                .formLogin();

    }
}

